-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gnovm): fix crash stack overflow when print value of self referencing structure #2851
fix(gnovm): fix crash stack overflow when print value of self referencing structure #2851
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2851 +/- ##
==========================================
+ Coverage 60.92% 60.95% +0.02%
==========================================
Files 564 564
Lines 75267 75389 +122
==========================================
+ Hits 45854 45950 +96
- Misses 26041 26048 +7
- Partials 3372 3391 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Ready for review ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you don't spend too much effort improving gonative
, as we want to remove it eventually: #1361.
In the meantime, LGTM.
Thanks for the PR; I'll close this as a won't fix as a real solution for printing these structures in gonative would require named type support in reflect. |
Fix stack overflow when printing value of recursive self referencing struct
resolve #2850
Methodology used
I added a stack to store the struct type already processed, then each time we process a struct i check if this struct type is already processed, if yes i remplace it by an empty struct so it avoid crash on recursive.
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description